/**
 * @desc 消息管理
 * @date 2023-08-31
 */
// 表头
const tableColumnData = [
  {
    label: '消息主题',
    prop: 'theme',
    tooltip: true,
    other: {
      color: '#409EFF'
    },
    align: "left"
  },
  {
    label: '消息编码',
    prop: 'code',
    tooltip: true,
  },
  {
    label: '发送者应用',
    prop: 'sendAppName',
    tooltip: true,
  },
  {
    label: '发送者',
    prop: 'sendApiName',
    tooltip: true,
  },
]
const tableVersionColumn = [
  {
    label: '接收者名称',
    prop: 'receiveName',
  },
  {
    label: '接收者编码',
    prop: 'receiveCode',
  },
  {
    label: '接收者应用',
    prop: 'receiveApp',
  },
  {
    label: '接收者',
    prop: 'receiveApi',
  },
  {
    label: '数据类型',
    prop: 'dataType',
  },
  {
    label: '返回类型',
    prop: 'returnType',
    options: [
      {
        value: "1",
        label: "BIP"
      },{
        value: "2",
        label: "中台BIP",
      }
    ]
  },
  {
    label: '备注',
    prop: 'remark',
  },
]

// 基本信息内容
const formRow = [
  {
    elCol: [{
      label: '消息主题',
      prop: 'theme',
      tag: 'elInput',
      span: 24
    }]
  },
  {
    elCol: [{
      label: '消息编码',
      prop: 'code',
      tag: 'elInput',
      span: 24
    }]
  },
  {
    elCol: [{
      label: '发送者应用',
      prop: 'sendApp',
      tag: 'elSelect',
      options: [],
      optionValue: 'id',
      optionLabel: 'name',
    }, {
      label: '发送者',
      prop: 'sendApi',
      tag: 'elSelect',
      options: [],
      optionValue: 'id',
      optionLabel: 'apiName',
    }]
  },
  {
    elCol: [{
      label: '数据类型',
      prop: 'dataType',
      tag: 'elRadio',
      options: [{
        label: '对象',
        value: '1'
      }, {
        label: '数组',
        value: '2'
      }
      ]
    },]
  },
  {
    elCol: [{
      label: '备注',
      prop: 'remark',
      tag: 'elInput',
      type: 'textarea',
      span: 24,
    }]
  },
]

const basicsRules = {
  theme: [{
    required: true,
    message: '请输入消息主题',
    trigger: 'blur'
  }],
  code: [{
    required: true,
    message: '请输入消息编码',
    trigger: 'blur'
  }],
  sendApp: [{
    required: true,
    message: '请选择发送者应用',
    trigger: 'blur'
  }],
  sendApi: [{
    required: true,
    message: '请选择发送者',
    trigger: 'blur'
  }],
  dataType: [{
    required: true,
    message: '请选择数据类型',
    trigger: 'blur'
  }],
}

// 查看
const formRowShow = [
  {
    elCol: [{
      label: '消息主题',
      prop: 'theme',
      tag: 'elInput',
      disabled: true,
      span: 24
    }]
  },
  {
    elCol: [{
      label: '消息编码',
      prop: 'code',
      tag: 'elInput',
      disabled: true,
      span: 24
    }]
  },
  {
    elCol: [{
      label: '发送者应用',
      prop: 'sendApp',
      tag: 'elSelect',
      options: [],
      optionValue: 'id',
      optionLabel: 'name',
      disabled: true,
    }, {
      label: '发送者',
      prop: 'sendApi',
      tag: 'elSelect',
      options: [],
      optionValue: 'id',
      optionLabel: 'apiName',
      disabled: true,
    }]
  },
  {
    elCol: [{
      label: '数据类型',
      prop: 'dataType',
      tag: 'elRadio',
      disabled: true,
      options: [{
        label: '对象',
        value: '1'
      }, {
        label: '数组',
        value: '2'
      }
      ]
    },]
  },
  {
    elCol: [{
      label: '备注',
      prop: 'remark',
      tag: 'elInput',
      type: 'textarea',
      disabled: true,
      span: 24,
    }]
  },
]
export default {
  tableColumnData,
  formRow,
  basicsRules,
  formRowShow,
  tableVersionColumn
}
